package com.ruoyi.guidance.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.guidance.mapper.JwStuCompetitionGuidanceMapper;
import com.ruoyi.guidance.domain.JwStuCompetitionGuidance;
import com.ruoyi.guidance.service.IJwStuCompetitionGuidanceService;

/**
 * 学科竞赛指导Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@Service
public class JwStuCompetitionGuidanceServiceImpl implements IJwStuCompetitionGuidanceService 
{
    @Autowired
    private JwStuCompetitionGuidanceMapper jwStuCompetitionGuidanceMapper;

    /**
     * 查询学科竞赛指导
     * 
     * @param scgId 学科竞赛指导主键
     * @return 学科竞赛指导
     */
    @Override
    public JwStuCompetitionGuidance selectJwStuCompetitionGuidanceByScgId(Long scgId)
    {
        return jwStuCompetitionGuidanceMapper.selectJwStuCompetitionGuidanceByScgId(scgId);
    }

    /**
     * 查询学科竞赛指导列表
     * 
     * @param jwStuCompetitionGuidance 学科竞赛指导
     * @return 学科竞赛指导
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<JwStuCompetitionGuidance> selectJwStuCompetitionGuidanceList(JwStuCompetitionGuidance jwStuCompetitionGuidance)
    {
        return jwStuCompetitionGuidanceMapper.selectJwStuCompetitionGuidanceList(jwStuCompetitionGuidance);
    }

    /**
     * 新增学科竞赛指导
     * 
     * @param jwStuCompetitionGuidance 学科竞赛指导
     * @return 结果
     */
    @Override
    public int insertJwStuCompetitionGuidance(JwStuCompetitionGuidance jwStuCompetitionGuidance)
    {
        return jwStuCompetitionGuidanceMapper.insertJwStuCompetitionGuidance(jwStuCompetitionGuidance);
    }

    /**
     * 修改学科竞赛指导
     * 
     * @param jwStuCompetitionGuidance 学科竞赛指导
     * @return 结果
     */
    @Override
    public int updateJwStuCompetitionGuidance(JwStuCompetitionGuidance jwStuCompetitionGuidance)
    {
        jwStuCompetitionGuidance.setUpdateTime(DateUtils.getNowDate());
        return jwStuCompetitionGuidanceMapper.updateJwStuCompetitionGuidance(jwStuCompetitionGuidance);
    }

    /**
     * 批量删除学科竞赛指导
     * 
     * @param scgIds 需要删除的学科竞赛指导主键
     * @return 结果
     */
    @Override
    public int deleteJwStuCompetitionGuidanceByScgIds(Long[] scgIds)
    {
        return jwStuCompetitionGuidanceMapper.deleteJwStuCompetitionGuidanceByScgIds(scgIds);
    }

    /**
     * 删除学科竞赛指导信息
     * 
     * @param scgId 学科竞赛指导主键
     * @return 结果
     */
    @Override
    public int deleteJwStuCompetitionGuidanceByScgId(Long scgId)
    {
        return jwStuCompetitionGuidanceMapper.deleteJwStuCompetitionGuidanceByScgId(scgId);
    }
}
